<include file='public/_meta'>

<div class="page-container">
	<div class="Huialert Huialert-success"><i class="Hui-iconfont">&#xe6a6;</i>
		<p class="c-primary">
		 	操作提示
		</p>
		<ul>
		  <li>EXCEL数据导入</li>

		  <li>请确保数据格式与标准模板一致</li>

		  <li><a class="btn btn-primary radius" href="{:url('excel_null')}" target="_blank">下载标准模板</a></li>
		</ul>
	</div>
	<form action="{:url('excel_data')}" method="post" enctype="multipart/form-data" class="form form-horizontal" id="form-type-add">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">
				<span class="c-red">*</span>
				上传文件：</label>
			<div class="formControls col-xs-6 col-sm-6">
				<span class="btn-upload form-group">
                        <input class="input-text upload-url" type="text" id="uploadfile" readonly style="width:200px">
                        <a href="javascript:void();" class="btn btn-primary radius upload-btn"><i class="Hui-iconfont">&#xe642;</i> 浏览文件</a>
                        <input type="file" name="excel" class="input-file">
                        </span> 
			</div>
		</div>
		<div class="row cl">
			<div class="col-9 col-offset-2">
				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;确认提交&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</div>

<!--_footer 作为公共模版分离出去-->
<include file='public/_footer'>
<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本--> 
<script type="text/javascript" src="__PUBLIC__/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="__PUBLIC__/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="__PUBLIC__/lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="__PUBLIC__/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript">
$(function(){

	$("#form-type-add").validate({
		rules:{
			name:{
				required:true,
				maxlength:60
			},
			
		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			$(form).ajaxSubmit({
				dataType: 'json',
				success: function(data) { 
				 	var index = parent.layer.getFrameIndex(window.name);
					//parent.$('.btn-refresh').click();
	                if(data['code']==1){
	                
	                	layer.msg(data['msg'], {icon:6,time:1000},function(){

							parent.location.href = '{:url('index')}';              		
							// parent.layer.close(index);
	                	});

	                }else{
	                	layer.msg(data['msg']);

	                }
	                if(data.code==0){
	                	layer.msg("登录失效,请重新登录");
	                }
            	},
            	error:function(data){
					layer.msg('表格数据格式不规范');
            	},


			});

		}
	});
});

</script> 
<!--/请在上方写此页面业务相关的脚本-->